/*
 * Created by JFormDesigner on Thu May 26 16:47:37 CST 2022
 */

package jw3.c10.view;

import jw3.c10.utils.DBConnection;

import java.awt.*;
import java.awt.event.*;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.Vector;
import javax.swing.*;
import javax.swing.table.DefaultTableModel;

/**
 * @author Brainrain
 */
public class Administrator extends JFrame {
    public Administrator() {
        initComponents();
        setSize(800,600);

        setTitle("云卡管理员");
        ImageIcon imgIcon = new ImageIcon("images\\s.jpg");
        JLabel im = new JLabel();
        im.setIcon(imgIcon);
        im.setBounds(0, 0, 800, 600);
        imgIcon.setImage(imgIcon.getImage().
                getScaledInstance(900, 700, 1));
        this.add(im);
        this.setVisible(true);
        this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    }


    private void menu1MouseClicked(MouseEvent e) {
        // TODO add your code here
        //用户管理
UserM userM=new UserM();

    }

    private void menu2MouseClicked(MouseEvent e) {
        // TODO add your code here
        //站点管理
Route R=new Route();

    }

    private void thisMouseClicked(MouseEvent e) {
        // TODO add your code here

    }

    private void button1MouseClicked(MouseEvent e) {
        // TODO add your code here
    }

    private void menu4MouseClicked(MouseEvent e) {
        // TODO add your code here
        //线路管理
RoleA r=new RoleA();
    }

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
        menuBar1 = new JMenuBar();
        menu1 = new JMenu();
        menu2 = new JMenu();
        menu4 = new JMenu();
        menu5 = new JMenu();

        //======== this ========
        addMouseListener(new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent e) {
                thisMouseClicked(e);
            }
        });
        Container contentPane = getContentPane();
        contentPane.setLayout(null);

        //======== menuBar1 ========
        {

            //======== menu1 ========
            {
                menu1.setText("\u7528\u6237\u57fa\u672c\u4fe1\u606f\u7ba1\u7406");
                menu1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
                menu1.addMouseListener(new MouseAdapter() {
                    @Override
                    public void mouseClicked(MouseEvent e) {
                        menu1MouseClicked(e);
                    }
                });
            }
            menuBar1.add(menu1);

            //======== menu2 ========
            {
                menu2.setText("\u7ad9\u70b9\u7ba1\u7406");
                menu2.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
                menu2.addMouseListener(new MouseAdapter() {
                    @Override
                    public void mouseClicked(MouseEvent e) {
                        menu2MouseClicked(e);
                    }
                });
            }
            menuBar1.add(menu2);

            //======== menu4 ========
            {
                menu4.setText("\u7ebf\u8def\u7ba1\u7406");
                menu4.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
                menu4.addMouseListener(new MouseAdapter() {
                    @Override
                    public void mouseClicked(MouseEvent e) {
                        menu4MouseClicked(e);
                    }
                });
            }
            menuBar1.add(menu4);

            //======== menu5 ========
            {
                menu5.setText("\u666f\u70b9\u7ba1\u7406");
            }
            menuBar1.add(menu5);
        }
        setJMenuBar(menuBar1);

        {
            // compute preferred size
            Dimension preferredSize = new Dimension();
            for(int i = 0; i < contentPane.getComponentCount(); i++) {
                Rectangle bounds = contentPane.getComponent(i).getBounds();
                preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
            }
            Insets insets = contentPane.getInsets();
            preferredSize.width += insets.right;
            preferredSize.height += insets.bottom;
            contentPane.setMinimumSize(preferredSize);
            contentPane.setPreferredSize(preferredSize);
        }
        pack();
        setLocationRelativeTo(getOwner());
        // JFormDesigner - End of component initialization  //GEN-END:initComponents

    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables
    private JMenuBar menuBar1;
    private JMenu menu1;
    private JMenu menu2;
    private JMenu menu4;
    private JMenu menu5;
    // JFormDesigner - End of variables declaration  //GEN-END:variables

}
